package com.liaoban.app.ui.anchor;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.liaoban.app.R;
import com.liaoban.app.api.type.Report;

import java.util.List;

/**
 * Created by ybc on 2018/7/30 0030.
 * 举报
 */
public class ReportAdapter extends BaseQuickAdapter<Report, BaseViewHolder> {
    private int mSel = 0;

    public ReportAdapter(@Nullable List<Report> data) {
        super(R.layout.item_report, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Report item) {
        ImageView ivRadio = helper.getView(R.id.iv_radio);
        if (mSel == helper.getLayoutPosition()) {
            ivRadio.setSelected(true);
            helper.setTextColor(R.id.tv_title, mContext.getResources().getColor(R.color.text_black));
        } else {
            ivRadio.setSelected(false);
            helper.setTextColor(R.id.tv_title, mContext.getResources().getColor(R.color.text_gray));
        }
        helper.setText(R.id.tv_title, item.getTTitle());
    }

    public void setSel(int sel) {
        mSel = sel;
    }

    public int getSel() {
        return mSel;
    }
}
